import axios from "/@/utils/http/axios";
import {MethodEnum} from "/@/utils/http/axios/enum/method-enum";
import {PageModel} from "/@/api/system/model/CommonModel";
import {FlowGroupModel, FlowGroupQueryModel} from "/@/api/flow/model/FlowGroupModel";

/**
 * 分页查询流程分组列表
 * @param isHint
 * @param callBack
 */
export function listFlowGroupPage(data: FlowGroupQueryModel,callBack?: Function):Promise<PageModel<FlowGroupModel[]>> {
    return axios.httpRequest("/flow/group/listFlowGroupPage", MethodEnum.GET, data, {callBack});
}


/**
 * 新增流程分组
 * @param callBack
 */
export function insertFlowGroup(data: FlowGroupModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/flow/group/insertFlowGroup", MethodEnum.POST, data, {callBack});
}

/**
 * 修改流程分组
 * @param callBack
 */
export function updateFlowGroup(data: FlowGroupModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/flow/group/updateFlowGroup", MethodEnum.POST, data, {callBack});
}

/**
 * 根据流程分组id删除流程分组
 * @param data
 * @param callBack
 */
export function deleteFlowGroupByGroupId(groupId: string,callBack?: Function):Promise<void> {
    return axios.httpRequest("/flow/group/deleteFlowGroupByGroupId", MethodEnum.GET, {groupId}, {callBack});
}

/**
 * 根据流程分组id查询流程分组
 * @param groupId
 * @param callBack
 */
export function selectFlowGroupByGroupId(groupId: string,callBack?: Function):Promise<FlowGroupModel> {
    return axios.httpRequest("/flow/group/selectFlowGroupByGroupId", MethodEnum.GET, {groupId}, {callBack});
}


/**
 * 查询所有流程分组
 * @param isHint
 * @param callBack
 */
export function listFlowGroupAll(callBack?: Function):Promise<FlowGroupModel[]> {
    return axios.httpRequest("/flow/group/listFlowGroupAll", MethodEnum.GET, {}, {callBack});
}
